Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed clarification in documentation: #1004

Merged
merged 2 commits into from Feb 15, 2012
Merged

Proposed clarification in documentation: #1004

merged 2 commits into from Feb 15, 2012

Conversation

peterp
Copy link
Contributor

@peterp peterp commented Feb 14, 2012

Accounts.reset(<%= ... %>) to accounts.reset(<%= ... %>)
Projects.reset(<%= ... %>) to projects.reset(<%= ... %>)

As it's popular in JavaScript to capitalize constructors it might be confusing in this context.

@braddunbar
Copy link
Collaborator

👍

@jashkenas
Copy link
Owner

I dunno -- maybe I'm just old fashioned, but I like to have capitals for my top-level objects...

If we make this documentation change, does this PR cover all of the places where we use caps for non-constructors?

@braddunbar
Copy link
Collaborator

I see, Accounts is capitalized because it's a global. In that case, perhaps we should just ensure that it's clear Accounts is a collection instance and not a constructor.

var Accounts = new Backbone.Collection();
Accounts.reset(<%= ... %>);

@peterp
Copy link
Contributor Author

peterp commented Feb 14, 2012

I'll go through the documentation to make sure,

  • or -

The documentation could also create the collection to avoid any possible confusion:

var Accounts = new Collection(); Accounts.reset(<% ... %>);

@braddunbar
Copy link
Collaborator

For what it's worth, there is some precedent here.

@jashkenas
Copy link
Owner

Let's go that way then. Also, no need for parens when new-ing a value without params.

var Accounts = new Backbone.Collection;

Peter Pistorius and others added 2 commits February 14, 2012 22:57
`Accounts.reset(<%= ... %>)` to `accounts.reset(<%= ... %>)`
`Projects.reset(<%= ... %>)` to `projects.reset(<%= ... %>)`

As it's popular in JavaScript to capitalize constructors it might be confusing in this context.
braddunbar added a commit that referenced this pull request Feb 15, 2012
Proposed clarification in documentation:
@braddunbar braddunbar merged commit cf93180 into jashkenas:master Feb 15, 2012
@braddunbar
Copy link
Collaborator

Thanks @peterp!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants